package com.altio.swing;


import java.awt.Color;
import java.awt.event.KeyEvent;

/**
 * Class that describes the configuration of the {@link DraggableLayeredPane} whilst the user is moving or resizing a
 * component with the mouse.
 * 
 * @author tomm
 * @altioapi all
 * 
 */
public class DraggableConstraints {

  /** Don't snap components to any guides */
  public static final int                  SNAPTO_NONE         = 0;
  
  /** Use a grid to as a guide to snap components to */
  public static final int                  SNAPTO_GRID         = 1;
  
  /** Use a other components to as a guide to snap components to */
  public static final int                  SNAPTO_COMPONENTS   = 2;

  /** Default instance of this class */
  public static final DraggableConstraints DEFAULT_CONSTRAINTS = new DraggableConstraints();

  /** True if contained components should not go outside the bounds of this control */
  public boolean                           constrainInBoundsMin  = false;
  
  /** True if contained components should not go outside the bounds of this control */
  public boolean                           constrainInBoundsMax  = false;

  /** True if contained components are allowed to be resized larger than this control */
  public boolean                           childrenCanBeLarger = true;
  
  /** If the user drags the component out of the visible rectangle should we scroll? */
  public boolean                           scrollWhenDraggingOutOfBounds = true;

  /** Snap to mode */
  public int                               snapToMode          = SNAPTO_NONE;

  /** How close to a snap line you need to be to snap to it */
  public int                               snapToGranularity   = 5;

  /** Whether or not to draw the snap to lines */
  public boolean                           drawingGuidelines   = false;

  /** How see through the snap to lines should be */
  public float                             guideOpacity        = 0.5f;

  /** What color the snap to lines should be */
  public Color                             guideColor          = Color.blue;
  
  /** Should contained components can be moved with the keyboard*/
  public boolean                           moveWithKeys        = true;
  
  /** Key used to move a control up */
  public int                               upKey               = KeyEvent.VK_UP;
  
  /** Key used to move a control down */
  public int                               downKey             = KeyEvent.VK_DOWN;
  
  /** Key used to move a control left */
  public int                               leftKey             = KeyEvent.VK_LEFT;
  
  /** Key used to move a control right */
  public int                               rightKey            = KeyEvent.VK_RIGHT;

}
